/**
 * 
 */
package com.yidin.lsc;

import java.util.HashMap;
import java.util.Map;

import com.yidin.entry.AccountDetailEntry;
import com.yidin.logic.MainService;
import com.yidin.logic.Task;

import android.os.Bundle;
import android.widget.TextView;

/**
 * 用户个人资料
 * @author cola
 *
 */
public class MyFriendsDatil extends BaseActivity{
	private AccountDetailEntry l = null;
	private TextView tvIsMarry;
	private TextView tvSalary;
	private TextView tvHeight;
	private TextView tvPalFor;
	private TextView tvProfession;
	private TextView tvSchool;
	private TextView tvHobby;
	private TextView tvHomepage;
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.frienddata);
		init();
	}
	
	@Override
	public void init() {
		// TODO Auto-generated method stub
		Map obj = new HashMap<String, String>();
		obj.put("AccountId", "hlf");

		showProgress(this);
		Task task = new Task(Task.TASK_ACCOUNT_DETAIL, obj);
		MainService.AddNewTask(task);
		
		this.tvIsMarry = (TextView) findViewById(R.id.friends_IsMarry);
		this.tvSalary = (TextView) findViewById(R.id.friends_Salary);
		this.tvHeight = (TextView) findViewById(R.id.friends_height);
		this.tvPalFor = (TextView) findViewById(R.id.friends_PalFor);
		this.tvProfession = (TextView) findViewById(R.id.friends_profession);
		this.tvSchool = (TextView) findViewById(R.id.friends_school);
		this.tvHobby = (TextView) findViewById(R.id.friends_hobby);
		this.tvHomepage = (TextView) findViewById(R.id.friends_homePage);
	}

	@Override
	public void refresh(Object... param) {
		// TODO Auto-generated method stub
		int task = (Integer) param[0];
		switch (task) {
		case Task.TASK_MYDYNAMIC_LIST:
			l = (AccountDetailEntry) param[1];
			if(l == null) return;
			
			this.tvIsMarry.setText(l.IsMarry);
			this.tvSalary.setText(l.Salary);
			this.tvHeight.setText(l.Height);
			this.tvPalFor.setText(l.PalFor);
			this.tvProfession.setText(l.Profession);
			this.tvSchool.setText(l.School);
			this.tvHobby.setText(l.Hobby);
			this.tvHomepage.setText(l.Homepage);
			break;
		}
	}

	@Override
	protected boolean isRouteDisplayed() {
		// TODO Auto-generated method stub
		return false;
	}

}
